package com.itheima.mapper;

import com.itheima.dto.SetDefaultDto;
import com.itheima.pojo.AddressBook;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author YangJiaHao
 */
@Mapper
public interface AddressBookMapper {

    Integer updateIsDefaultById(@Param("setDefaultDto") SetDefaultDto setDefaultDto);

    Integer updateIsDefaultByUserId(@Param("userId") String UserId);

    AddressBook selectDefault(@Param("userId") String userId);

    Integer insertAddressBook(@Param("addressBook") AddressBook addressBook);

    AddressBook selectById(@Param("id") String id);

    List<AddressBook> selectByUserId(@Param("userId") String userId);

    Integer delete(@Param("split") String[] split);

    Integer updateAddressBook(@Param("addressBook") AddressBook addressBook);
}
